package com.pension.dao;

import com.pension.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @ClassName: UserDao
 * @Description: GOOD
 * @author: ZZL
 * @date: 2021/3/18  16:15
 */
@Mapper
public interface UserDao {
    //保存用户的方法mapper
    void save(User user);
    //登录的方法
    User findByUsernameAndPassword(@Param("username") String username, @Param("password") String password);
    //注册用户时检查是否重复
    User findByUserName(String username);

    //权限管理
    Integer authoritymanagement(@RequestParam("username")String username,@RequestParam("password")String password);

    User findUserByIdWithParam(String id);

    void updateUser(User user);

    //查看所有用户
    List<User> findAllUser();

    //改变权限-普通
    void authority(int id);

    //改变权限-vip
    void authority2(int id);

   //删除
    void deleteByid(int id);



}
